﻿using UnityEngine.Playables;
using UnityEngine;
using FPLibrary;

namespace Pvp.Timeline
{
    /// <summary>
    /// 控制角色移动
    /// </summary>
    public class RoleMoveControlBehaviour : BaseRolePlayableBehaviour
    {
        // private RolexxxEntity.RoleControlData controlData = null;
        // public AnimationClip idleClip;
        // public AnimationClip moveClip;
        //
        // public override void OnBehaviourPlay(Playable playable, FrameData info)
        // {
        //     base.OnBehaviourPlay(playable, info);
        //     controlData = Rolexxx.Control;
        // }
        //
        // public override void ProcessFrame(Playable playable, FrameData info, object playerData)
        // {
        //     if (controlData.rotateEngle == 0) //stop
        //     {
        //         //idle
        //         var tt1 = Mathf.Clamp((float)playable.GetTime(), 0, idleClip.length);
        //         idleClip.SampleAnimation(Rolexxx.gameObject, tt1);
        //         return;
        //     }
        //     //移动
        //     Fix64 rad = controlData.rotateEngle * FPMath.Deg2Rad;
        //     Rolexxx.Trans.position += new FPVector(FPMath.Cos(rad),0, FPMath.Sin(rad));
        //
        //     var tt2 = Mathf.Clamp((float)playable.GetTime(), 0, moveClip.length);
        //     moveClip.SampleAnimation(Rolexxx.gameObject, tt2);
        //
        //     UnityEngine.Debug.Log("移动控制");
        // }
    }
}



